3.7.56 \(\int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx\) [656]

Optimal. Leaf size=195 \[ \frac {(A+i B) F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)}+\frac {(A-i B) F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)} \]

[Out]

1/2*(A+I*B)*AppellF1(1-m,1,-n,2-m,-I*tan(d*x+c),-b*tan(d*x+c)/a)*cot(d*x+c)^(-1+m)*(a+b*tan(d*x+c))^n/d/(1-m)/
((1+b*tan(d*x+c)/a)^n)+1/2*(A-I*B)*AppellF1(1-m,1,-n,2-m,I*tan(d*x+c),-b*tan(d*x+c)/a)*cot(d*x+c)^(-1+m)*(a+b*
tan(d*x+c))^n/d/(1-m)/((1+b*tan(d*x+c)/a)^n)

________________________________________________________________________________________

Rubi [A]
time = 0.30, antiderivative size = 195, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {4326, 3684, 3683, 140, 138} \begin {gather*} \frac {(A+i B) \cot ^{m-1}(c+d x) (a+b \tan (c+d x))^n \left (\frac {b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right )}{2 d (1-m)}+\frac {(A-i B) \cot ^{m-1}(c+d x) (a+b \tan (c+d x))^n \left (\frac {b \tan (c+d x)}{a}+1\right )^{-n} F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right )}{2 d (1-m)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^m*(a + b*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]

[Out]

((A + I*B)*AppellF1[1 - m, -n, 1, 2 - m, -((b*Tan[c + d*x])/a), (-I)*Tan[c + d*x]]*Cot[c + d*x]^(-1 + m)*(a +
b*Tan[c + d*x])^n)/(2*d*(1 - m)*(1 + (b*Tan[c + d*x])/a)^n) + ((A - I*B)*AppellF1[1 - m, -n, 1, 2 - m, -((b*Ta
n[c + d*x])/a), I*Tan[c + d*x]]*Cot[c + d*x]^(-1 + m)*(a + b*Tan[c + d*x])^n)/(2*d*(1 - m)*(1 + (b*Tan[c + d*x
])/a)^n)

Rule 138

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[c^n*e^p*((b*x)^(m +
 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rule 140

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[c^IntPart[n]*((c +
d*x)^FracPart[n]/(1 + d*(x/c))^FracPart[n]), Int[(b*x)^m*(1 + d*(x/c))^n*(e + f*x)^p, x], x] /; FreeQ[{b, c, d
, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !IntegerQ[n] &&  !GtQ[c, 0]

Rule 3683

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[A^2/f, Subst[Int[(a + b*x)^m*((c + d*x)^n/(A - B*x)), x], x, Tan[e +
 f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] &&  !IntegerQ
[m] &&  !IntegerQ[n] &&  !IntegersQ[2*m, 2*n] && EqQ[A^2 + B^2, 0]

Rule 3684

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(A + I*B)/2, Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(1 -
 I*Tan[e + f*x]), x], x] + Dist[(A - I*B)/2, Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^n*(1 + I*Tan[e +
f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] &&  !Integ
erQ[m] &&  !IntegerQ[n] &&  !IntegersQ[2*m, 2*n] && NeQ[A^2 + B^2, 0]

Rule 4326

Int[(cot[(a_.) + (b_.)*(x_)]*(c_.))^(m_.)*(u_), x_Symbol] :> Dist[(c*Cot[a + b*x])^m*(c*Tan[a + b*x])^m, Int[A
ctivateTrig[u]/(c*Tan[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] &&  !IntegerQ[m] && KnownTangentIntegrandQ
[u, x]

Rubi steps

\begin {align*} \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx &=\left (\cot ^m(c+d x) \tan ^m(c+d x)\right ) \int \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx\\ &=\frac {1}{2} \left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \int (1+i \tan (c+d x)) \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n \, dx+\frac {1}{2} \left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \int (1-i \tan (c+d x)) \tan ^{-m}(c+d x) (a+b \tan (c+d x))^n \, dx\\ &=\frac {\left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \text {Subst}\left (\int \frac {x^{-m} (a+b x)^n}{1-i x} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {\left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x)\right ) \text {Subst}\left (\int \frac {x^{-m} (a+b x)^n}{1+i x} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac {\left ((A-i B) \cot ^m(c+d x) \tan ^m(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}\right ) \text {Subst}\left (\int \frac {x^{-m} \left (1+\frac {b x}{a}\right )^n}{1-i x} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {\left ((A+i B) \cot ^m(c+d x) \tan ^m(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}\right ) \text {Subst}\left (\int \frac {x^{-m} \left (1+\frac {b x}{a}\right )^n}{1+i x} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac {(A+i B) F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},-i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)}+\frac {(A-i B) F_1\left (1-m;-n,1;2-m;-\frac {b \tan (c+d x)}{a},i \tan (c+d x)\right ) \cot ^{-1+m}(c+d x) (a+b \tan (c+d x))^n \left (1+\frac {b \tan (c+d x)}{a}\right )^{-n}}{2 d (1-m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]
time = 4.85, size = 0, normalized size = 0.00 \begin {gather*} \int \cot ^m(c+d x) (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx \end {gather*}

Verification is not applicable to the result.

[In]

Integrate[Cot[c + d*x]^m*(a + b*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]

[Out]

Integrate[Cot[c + d*x]^m*(a + b*Tan[c + d*x])^n*(A + B*Tan[c + d*x]), x]

________________________________________________________________________________________

Maple [F]
time = 0.52, size = 0, normalized size = 0.00 \[\int \left (\cot ^{m}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^m*(a+b*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)

[Out]

int(cot(d*x+c)^m*(a+b*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^m*(a+b*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

integrate((B*tan(d*x + c) + A)*(b*tan(d*x + c) + a)^n*cot(d*x + c)^m, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^m*(a+b*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

integral((B*tan(d*x + c) + A)*(b*tan(d*x + c) + a)^n*cot(d*x + c)^m, x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**m*(a+b*tan(d*x+c))**n*(A+B*tan(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^m*(a+b*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

integrate((B*tan(d*x + c) + A)*(b*tan(d*x + c) + a)^n*cot(d*x + c)^m, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {cot}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^m*(A + B*tan(c + d*x))*(a + b*tan(c + d*x))^n,x)

[Out]

int(cot(c + d*x)^m*(A + B*tan(c + d*x))*(a + b*tan(c + d*x))^n, x)

________________________________________________________________________________________